package de.mindshareprojects.datawarehouse.client;


import java.util.ArrayList;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import de.mindshareprojects.datawarehouse.shared.Advertiser;
import de.mindshareprojects.datawarehouse.shared.Campaign;
import de.mindshareprojects.datawarehouse.shared.WebAnalyticsLineItem;

@RemoteServiceRelativePath("data")
public interface DataService extends RemoteService {
	
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Campaign>
	 */
	Campaign createCampaign(Campaign campaign) throws IllegalArgumentException;
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Advertiser>
	 */
	Advertiser createAdvertiser(Advertiser advertiser) throws IllegalArgumentException;
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.WebAnalyticsLineItem>
	 */
	WebAnalyticsLineItem createWebAnalyticsLineItem(WebAnalyticsLineItem webAnalyticsLineItem) throws IllegalArgumentException;

	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Advertiser>
	 */
	ArrayList<Advertiser> getAdvertisers();

	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Advertiser>
	 */
	ArrayList<Advertiser> getWebAnalyticsAdvertisers();

	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Advertiser>
	 */
	Advertiser getAdvertiser(Long advertiserKey);

	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Advertiser>
	 */
	ArrayList<Advertiser> getAdvertisersByCountry(String country);
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Campaign>
	 */
	ArrayList<Campaign> getCampaigns();
	
	Boolean saveAdvertiser(Advertiser advertiser);
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Campaign>
	 */
	ArrayList<Campaign> getCampaignsByCountry(String country);
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Campaign>
	 */
	ArrayList<Campaign> getCampaignsByAdvertiser(Long advertiserKey);
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Campaign>
	 */
	ArrayList<Campaign> getCampaignsByAdvertiserGroup(Long groupKey, String country);
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.WebAnalyticsLineItem>
	 */
	ArrayList<WebAnalyticsLineItem> getWebAnalyticsLineItemsByAdvertiserGroup(Long groupKey);
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.WebAnalyticsLineItem>
	 */
	ArrayList<WebAnalyticsLineItem> getWebAnalyticsLineItems();
	
	Boolean checkIfLineItemsExist(Long campaignKey);
	
	Boolean deleteCampaignItems(Long campaignKey);
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.WebAnalyticsLineItem>
	 */
	
	Boolean saveAllWebAnalyticsLineItems(ArrayList<WebAnalyticsLineItem> itemsToSave);

	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Advertiser>
	 */

	Boolean saveAllAdvertisers(ArrayList<Advertiser> itemsToSave);
	
	/**
	 * @gwt.typeArgs <de.mindshareprojects.datawarehouse.shared.Campaign>
	 */
	Boolean saveAllCampaigns(ArrayList<Campaign> itemsToSave);
	
	String getUploadURL(String urlRedirect);
}

